/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package bpel2rep.version.state.impl;

import bpel2rep.version.Version;
import bpel2rep.version.VersionState;
import bpel2rep.version.VersionStore;
import bpel2rep.version.state.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class StateFactoryImpl extends EFactoryImpl implements StateFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static StateFactory init() {
		try {
			StateFactory theStateFactory = (StateFactory)EPackage.Registry.INSTANCE.getEFactory("http://de.tiw.bpel2resp.version.state"); 
			if (theStateFactory != null) {
				return theStateFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new StateFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StateFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case StatePackage.LOCK_USE: return createLockUse();
			case StatePackage.LOCK_WORK: return createLockWork();
			case StatePackage.SIMULE_SESSION: return createSimuleSession();
			case StatePackage.FREE: return createFree();
			case StatePackage.INITIAL: return createInitial();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LockUse createLockUse() {
		LockUseImpl lockUse = new LockUseImpl();
		return lockUse;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LockWork createLockWork() {
		LockWorkImpl lockWork = new LockWorkImpl();
		return lockWork;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SimuleSession createSimuleSession() {
		SimuleSessionImpl simuleSession = new SimuleSessionImpl();
		return simuleSession;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public Free createFree() {
		FreeImpl free = new FreeImpl();
		return free;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Initial createInitial() {
		InitialImpl initial = new InitialImpl();
		return initial;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StatePackage getStatePackage() {
		return (StatePackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static StatePackage getPackage() {
		return StatePackage.eINSTANCE;
	}


	public LockWork createLockWork(Version version) {
		LockWorkImpl lockWork = new LockWorkImpl(version);
		return lockWork;
	}


	public Free createFree(Version v) {
		FreeImpl free = new FreeImpl(v);
		return free;
	}


	public SimuleSession createSimuleSession(Version v) {
		// TODO Auto-generated method stub
		return null;
	}


	public VersionState createInitial(Version version) {
		InitialImpl initial = new InitialImpl(version);
		return initial;
	}

} //StateFactoryImpl
